package com.kgc.crow.distributioncrowdcommon.api;

import com.kgc.crow.distributioncrowdcommon.pojo.MemberLaunchInfoPO;
import com.kgc.crow.distributioncrowdcommon.pojo.ResultEntity;
import com.kgc.crow.distributioncrowdcommon.vo.MemberSignSuccessVO;
import com.kgc.crow.distributioncrowdcommon.vo.MemberVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("DISTRIBUTION-CROWD-MEMBER-MANAGER")
public interface MemberOperationRemoteService {
    /**
     * 发送验证码
     * @param phoneNum
     * @return
     */
    @RequestMapping("/member/manager/send/code")
    public ResultEntity<String> sendCode(@RequestParam("phoneNum") String phoneNum);

    /**
     * 注册
     * @param memberVO
     * @return
     */
    @RequestMapping("/register")
    public ResultEntity<String> register(@RequestBody MemberVO memberVO);

    /**
     * 登录
     * @param loginAcct
     * @param userPswd
     * @return
     */
    @RequestMapping("/login")
    public ResultEntity<MemberSignSuccessVO> login(
            @RequestParam("loginAcct") String loginAcct,
            @RequestParam("userPswd") String userPswd);

    /**
     * 退出
     * @param token
     * @return
     */
    @RequestMapping("/logout")
    public ResultEntity<String> logout(@RequestParam("token") String token);

    /**
     * 根据token查询供应人
     * @param token
     * @return
     */
    @RequestMapping("/retrieve/member/launch/info/by/member/token")
    public ResultEntity<MemberLaunchInfoPO> resultEntity(@RequestParam("token") String token);
}
